<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../极果网.html/试用.css">
    <script src="./jquery.min.js"></script>
</head>

<body>
    <div>
        <!-- 导航栏 -->
        <div class="head">
            <div class="head-0">
                <!-- 左边的图标 -->
                <div class="head-1">
                    <h1>
                        <a href="./首页.html">
                            <img src="../极果网.html/img1/logonew.png" alt="">
                        </a>
                    </h1>
                </div>
                <!-- 右边的图标 -->
                <div class="head-2">
                    <a href="">
                        <img src="../极果网.html/./img1/head-2图标.png" alt="">
                        <span>分销伙伴招募中！</span>
                    </a>
                </div>
                <!-- 中间的导航栏 -->
                <div class="head-3">
                    <ul>
                        <li class="on"><a href="../极果网.html/首页.html">首页</a></li>
                        <li class=""><a href="../极果网.html/试用.html">试用</a></li>
                        <li class=""><a href="../极果网.html/酷玩.html">酷玩</a></li>
                        <li class=""><a href="../极果网.html/导购.html">导购</a></li>
                        <li class=""><a href="../报告.html">报告</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <!-- 试用部分 -->
        <!-- 下方大导航栏 -->
        <div class="f1">
            <div class="faxian-kuwan">免费试用</div>
            <div class="father">
                <div id="zui3" class="zui1 active">大众试用</div>
                <div id="zui4" class="zui1">体验式专享</div>
            </div>
            <div class="father">
                <div class="zui2">全部</div>
                <div class="zui2">申请中</div>
                <div class="zui2">试用中</div>
                <div class="zui2">已结束</div>
            </div>
        </div>
        <div class="re-max">
            <div class="body-remen free1">
                <!-- 渲染的数据 -->
            </div>
            <div class="body-remen free2">
                <!-- 渲染的数据 -->
            </div>
        </div>
        <div class="jiazai"><img src="./img/more.png" alt="">点击加载更多</div>
        <!-- 尾部 -->
        <div class="btm">
            <!-- 结尾 -->
            <div class="btm-1">
                <img src="./img/erweima.png" alt="" class="erweima">
                <div class="btm-2">
                    <img src="./img/logoImg.jpg" alt="" width="110px">
                    <p class="btm-p">
                        全球酷玩试用导购平台酷·新奇·好玩·品质
                        <br>
                        <br>
                        微信添加&nbsp;"JguoJguo"获取我们的服务
                    </p>
                </div>
                <div class="btm-3">
                    <dt>
                        免费使用
                        <dl class="dl">
                            <dd>试用流程</dd>
                            <dd>如何提高成功率</dd>
                        </dl>
                    </dt>
                    <dt>
                        友情链接
                        <dl class="dl">
                            <dd>智东西&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WIBUSI</dd>
                            <dd>搜狐IT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;腾讯科技</dd>
                            <dd>搜狐数码&nbsp;&nbsp;&nbsp;&nbsp;凤凰科技</dd>
                            <dd>凤凰数码&nbsp;&nbsp;&nbsp;&nbsp;PConline</dd>
                            <dd>泡泡网&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3W咖啡</dd>
                            <dd>ZUK社区&nbsp;&nbsp;&nbsp;&nbsp;亿觅emie</dd>
                            <dd>极客公园&nbsp;&nbsp;&nbsp;&nbsp;易迅易启玩</dd>
                            <dd>果库</dd>
                            <dd></dd>
                        </dl>
                    </dt>
                    <dt>
                        购买攻略
                        <dl class="dl">
                            <dd>美亚海阔教程</dd>
                            <dd>日亚海阔教程</dd>
                            <dd>海阔转运攻略</dd>
                            <dd>kickstarter &nbsp;&nbsp;众筹购买攻略</dd>
                            <dd>indiegogo &nbsp;&nbsp;众筹购买攻略</dd>
                        </dl>
                    </dt>
                    <dt class="dt1">
                        厂商合作
                        <dl class="dl">
                            <dd>关于极果</dd>
                            <dd>联系我们</dd>
                            <dd>商务合作&nbsp;:&nbsp;BD@jiguo.com</dd>
                            <dd>CEO邮箱&nbsp;:&nbsp;CEO@jiguo.com</dd>
                        </dl>
                    </dt>
                </div>
            </div>
            <p class="jiewei"> @ 2016 极果版权所有</p>
        </div>
    </div>
    <script>
        //全部里的数据
        $(function () {
            var aaa = document.querySelector('.body-remen')
            $.ajax({
                url: 'http://localhost:3000/play/hot',
                type: 'get',
                success: function (arr) {
                    for (var i = 0; i < arr.length; i++) {
                        var data = arr[i]
                        for (var j = 0; j < data.length; j++) {
                            var div = document.createElement('div')
                            var imgs = document.createElement('img')
                            var ps = document.createElement('p');
                            var buttons = document.createElement('button')
                            var btn_two = document.createElement('button')
                            var pp = document.createElement('p')
                            var pps = document.createElement('p')
                            pps.innerText = '剩余时间2天'
                            pps.className = 'pps'
                            pp.innerHTML = '<span class="span1">1392</span>申请'
                            pp.className = 'pp'
                            buttons.innerText = 2032
                            btn_two.innerText = '20台'
                            buttons.className = 'btn-lun1'
                            btn_two.className = 'btn-lun2'
                            ps.innerText = data[j].text
                            ps.className = 'p-lun'
                            imgs.className = 'imgs-lun'
                            div.className = 'div-lun'
                            imgs.src = data[j].img
                            div.appendChild(imgs)
                            div.appendChild(ps)
                            div.appendChild(buttons)
                            div.appendChild(btn_two)
                            div.appendChild(pp)
                            div.appendChild(pps)
                            aaa.appendChild(div)
                        }
                    }
                }
            })
        })
        //点击事件
        $(function () {
            // js加载的时间放在最后 先加载文档 让用户看到
            var titles = $('.zui1');
            var div1 = $('.free1')
            var div2 = $('.free2')
            $.each(titles, function (index, el) {
                $(el).click(function () {
                    // 点击事件
                    // 先清除所有的active 然后给当前点击的元素添加active
                    $('.zui1.active').removeClass('active');
                    $(this).addClass('active');
                    var contentName = $(this).attr('content1');;
                    // 上面是切换标题，还需要切换内容，也就是3个大div的显示隐藏
                    // 发请求获取对应的数据--根据点击的标题不同 请求地址也不同
                    if (contentName === '.free1') {
                        div1.show();
                        div2.hide();
                        // 调接口 获取数据
                        getData('body-remen')
                    } else if (contentName === '.free2') {
                        div1.hide();
                        div2.show();                 
                        getData('body-remen')
                    } 
                })
            })
        })
    </script>
</body>

</html>